package office.dao.business;

import java.util.Iterator;
import java.util.Map;

import platform.common.dao.impl.BaseDomainProviderImpl;

public class GoodsOrderDP extends BaseDomainProviderImpl{
	
	//方法描述: 根据项目名称获取标书信息
	public String findGoodsOrderByIdAndName(Map condMap){
		StringBuffer strBuf = new StringBuffer();
		strBuf.append(" from "+ this.getDomainClassName() + " where 1=1 ");
		Iterator it = condMap.keySet().iterator();
		while(it.hasNext()){
			String str = (String)it.next();
			if(str.equals("customerName")){
				strBuf.append(" and customerName like '%"+condMap.get(str)+"%' ");
			}
			if(str.equals("orderType")){
				strBuf.append(" and orderType = '"+condMap.get(str)+"' ");
			}
			
		}
		return strBuf.toString();
	}
	
	//方法描述: 根据合同ID获取备货单和发货单
	public String findGoodsOrderByContractId(Map condMap){
		StringBuffer strBuf = new StringBuffer();
		strBuf.append(" from "+ this.getDomainClassName() + " where 1=1 ");
		Iterator it = condMap.keySet().iterator();
		while(it.hasNext()){
			String str = (String)it.next();
			if(str.equals("contractId")){
				strBuf.append(" and contractId = '"+condMap.get(str)+"' ");
			}
			if(str.equals("orderType")){
				strBuf.append(" and orderType = '"+condMap.get(str)+"' ");
			}
		}
		return strBuf.toString();
	}
}
